﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>PrepareTest</title>
    <script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var testPaperID;
        $(document).ready(function () {
            $.ajaxSetup({ cache: false });
            $.getJSON("/Test/GetTest", function (json) {
                if (json.course != undefined) {
                    testPaperID = json.testPaperID;
                    $("#spCouse").append(json.course);
                    $("#spScore").append(json.score);
                    $("#spTime").append(json.time);
                } else {
                    $("body").empty();
                    $("body").append("<center><div style=' margin-top:20%'><span style=' color:Red'>您当前暂无考试！<span></div></center>")
                }
            });
        })

        function BeginTest() {
            $.getJSON("/Test/GetTest", function (json) {
                window.location = "/Test/Testing/" + testPaperID + "_" + json.courseID + "_" + json.score + "_" + json.time + "_" + json.testID;
            });
        }
    </script>
</head>
<body>
    <center>
        <div style="margin-top: 20%">
            <table>
                <tr>
                    <td>
                        <span>当前考试科目：</span>
                    </td>
                    <td>
                        <span id="spCouse" style="color: Red"></span>
                    </td>
                </tr>
                <tr>
                    <td>
                        <span>总分：</span>
                    </td>
                    <td>
                        <span id="spScore" style="color: Red"></span>分
                    </td>
                </tr>
                <tr>
                    <td>
                        <span>考试时间：</span>
                    </td>
                    <td>
                        <span id="spTime" style="color: Red"></span>分钟
                    </td>
                </tr>
            </table>
            <center>
                <input type="button" value="点击开始考试" onclick="BeginTest()" />
            </center>
        </div>
    </center>
</body>
</html>
